package com.dy.template;


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

public class ChromeDriverTestNg {
    WebDriver driver;

    @BeforeMethod
    public void SetUp() {
        System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe");
        driver = new org.openqa.selenium.chrome.ChromeDriver();
    }

    @Test
    public void test() {
        driver.get("https://www.baidu.com");
    }

    @AfterMethod
    public void afterMethod() {
       //driver.close();
    }
}
